#!/bin/bash

set -o errexit
set -o nounset



# Want everything to go to log file... how?  Wrap it in (). Exec doesn't seem to work well

DATE=`date +"%Y%m%d-%H%M"`

log_filename="./${0##*/}.log-${DATE}"

(



SCRIPT=install_freeswitch_per_freeswitch_org

SCRIPT_FILENAME=${SCRIPT}.include

echo " "
echo " "
echo " "
echo "This program will install the FREESWITCH system per the ${SCRIPT}"
echo " "
echo " "



echo "Want to start? y for yes, anything else is no"
read RESP

if [ "${RESP}" != "y" ]
then
	echo "Bye!"
        exit
else

echo "Starting installation...."
echo " "

source ${SCRIPT_FILENAME}

${SCRIPT}

fi



exit 0

) 2>&1 | tee "./${log_filename}"

